package com.easy.common.enumbean;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;


public enum Gender {
    MALE("男"),
    FEMALE("女");

    @EnumValue
    private final String value;


    Gender(String value) {
        this.value = value;
    }


    public String getValue() {
        return value;
    }

    @JsonCreator
    public static Gender fromValue(String value) {
        for (Gender gender : values()) {
            if (gender.value.equals(value)) {
                return gender;
            }
        }
        throw new IllegalArgumentException("No matching Gender enum found for value: " + value);
    }
}